import request from '@/utils/request'

// 查询所有菜单嵌套集合  和 角色已分配的菜单id列表
export const listNestedMenusAndCheckedMenuIds = roleId => {
  return request({
    url: `/admin/system/roleMenu/listRoleMenus/${roleId}`,
    method: 'GET',
  })
}
// 给角色分配菜单
export const AssignMenus2Role = (roleId, menuIds) => {
  return request({
    url: `/admin/system/roleMenu/assignMenus2Role/${roleId}`,
    method: 'POST',
    // menuIds: menuIds.join()   // [1,2,3]   ==>  menuIds: '1,2,3'
    params: { menuIds: menuIds.join() },
  })
}
